package com.yksj.healthtalk.ui.server;

import java.util.ArrayList;
import java.util.List;

import org.json.JSONObject;

import android.content.Context;
import android.os.Bundle;
import android.support.v4.app.ListFragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.ListView;
import android.widget.TextView;

import com.yksj.healthtalk.net.http.JsonHttpResponseHandler;
import com.yksj.healthtalk.ui.R;

/**
 * 新闻发布
 * @author tly
 */
public class ServerCenterNewsFragment extends ListFragment {
	
	final JsonHttpResponseHandler mResponseHandler = new JsonHttpResponseHandler(){
		public void onSuccess(int statusCode, org.json.JSONArray response) {
			
		};
	};
	
	@Override
	public void onActivityCreated(Bundle savedInstanceState) {
		super.onActivityCreated(savedInstanceState);
		
	}
	
	@Override
	public void onListItemClick(ListView l, View v, int position, long id) {
		super.onListItemClick(l, v, position, id);
		
	}
	
	static class  MListAdapter extends BaseAdapter{
		final Context mContext;
		final LayoutInflater mInflater;
		List<JSONObject> mlList = new ArrayList<JSONObject>();
		
		public MListAdapter(Context context) {
			mContext = context;
			mInflater = LayoutInflater.from(context);
		}
		
		@Override
		public int getCount() {
			// TODO Auto-generated method stub
			return mlList.size();
		}

		@Override
		public Object getItem(int position) {
			// TODO Auto-generated method stub
			return null;
		}

		@Override
		public long getItemId(int position) {
			// TODO Auto-generated method stub
			return position;
		}
		
		private String getName(){
			return "";
		}
		
		private String getTime(){
			return "";
		}

		@Override
		public View getView(int position, View convertView, ViewGroup parent) {
			ViewHolder viewHolder;
			
			if(convertView == null){
				convertView = mInflater.inflate(R.layout.server_center_news_push_item,null);
				viewHolder = new ViewHolder();
				convertView.setTag(viewHolder);
			}else{
				viewHolder = (ViewHolder)convertView.getTag();
			}
			
			return convertView;
		}
	}
	
	private static class ViewHolder{
		TextView nameTextV;
		TextView timeTextV;
	}
	
}
